import data_helper
from loguru import logger

if __name__ == '__main__':
    lines = open('Test_Datahelper_data.txt').readlines()
    closes = list(float(line) for line in lines)
    logger.debug(closes)

    data = DataHelper.DataHelper()
    data.closes = closes

    data.get_emas([3, 5, 8])
    ema = data.get_ema(5)
    logger.debug(f"ema_latest:{ema[-1]}, ema_previous:{ema[-2]}")

    assert abs(ema[-2] - 36749.48) < 0.01
